package com.atguigu.spzx.manager;

import com.atguigu.spzx.common.handler.SpzxGlobalExceptionHandler;
import com.atguigu.spzx.common.handler.config.MybatisPlusConfig;
import com.atguigu.spzx.common.log.annnotations.EnableSpzxLog;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

//启动类默认只能扫描自己所在包及子包中的组件
@EnableTransactionManagement
@EnableAsync //启用异步任务
@EnableScheduling
@SpringBootApplication(exclude = MybatisPlusConfig.class) //(exclude = DataSourceAutoConfiguration.class) 当前项目必须使用数据库连接池
//@ComponentScan(basePackages = {"com.atguigu.spzx"})
//@Import(SpzxGlobalExceptionHandler.class)
@EnableSpzxLog //引入日志模块中的 组件类
@MapperScan(basePackages = {"com.atguigu.spzx.common.log.mapper",
        "com.atguigu.spzx.manager.mapper"}) //mapperscan必须指定到mapper接口所在的包扫描
public class SpzxManagerApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpzxManagerApplication.class , args);
    }
}
